package com.baidu.controller;

import com.baidu.entity.*;
import com.baidu.service.CreditBankService;
import com.baidu.service.CreditIdentityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

/**
 * @author 田甜
 * @version 1.0
 * @description: TODO
 * @date 2021/12/13 0013 11:05
 */
@RestController
@RequestMapping("/tby")
@CrossOrigin
@Slf4j
//完善信息必填选项
public class CreditComplete {
    @Autowired
    private CreditIdentityService creditIdentityService;

    //完善信息身份证
    @PostMapping("/identity")
    public void identityInsert(@RequestBody TbyIdentity tbyIdentity)throws Exception{
        log.info("添加身份证信息");
        creditIdentityService.insert(tbyIdentity);
    }
    //添加银行卡信息
    @PostMapping("/bank")
    public void bankinsert(@RequestBody TbyBankcard tbyBankcard) throws IOException {
        log.info("银行卡信息");
        creditIdentityService.bankinsert(tbyBankcard);
    }
    //紧急联系人信息
    @PostMapping("/contcatmation")
    public void contcatmation(@RequestBody TbyContcatmation tbyContcatmation){
        log.info("紧急联系人和当前住址");
        creditIdentityService.catmationinsert(tbyContcatmation);
    }
    //三级联动下拉查询
    @PostMapping("/cityByid/{did}")
    public void cityByid(@PathVariable("did")Integer did){
        log.info("三级联动查询下拉");
        creditIdentityService.selectByid(did);
    }
}
